/**
 * @see [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-react.html#wxshowactionsheetobject)
 * @param itemList [string[]] 按钮的文字数组，数组长度最大为6个;
 * @param itemColor [string] 按钮的文字颜色，默认为"#000000";
 */
export default function showActionSheet(itemList: string[], itemColor?: string) {
	return new Promise<{
		msg: {
			tapIndex: number;
		};
		success: boolean;
	}>((resolve) => {
		wx.showActionSheet({
			itemColor,
			itemList,					// 按钮的文字数组，数组长度最大为6个
			success(res) {
				resolve({
					msg: res,
					success: true
				});
			},
			fail(res) {
				resolve({
					msg: res,
					success: false
				});
			}
		});
	});
}
